using System;
using System.Xml.Serialization;

using NetFramework.Collection;

namespace NetFramework.Web.Configuration
{
	/// <summary>
	/// 
	/// </summary>
	public class SharedScriptGroups
	{
		private string defaultGroup;
		private KeyedCollection<SharedScriptGroup> scriptGroups;

		/// <summary>
		/// 
		/// </summary>
		[XmlAttribute("default")]
		public string DefaultGroup
		{
			get { return defaultGroup; }
			set { defaultGroup = value; }
		}

		/// <summary>
		/// 
		/// </summary>
		[XmlElement("scriptGroup")]
		public KeyedCollection<SharedScriptGroup> ScriptGroups
		{
			get { return scriptGroups; }
			set { scriptGroups = value; }
		}

		/// <summary>
		/// 
		/// </summary>
		public SharedScriptGroup DefaultScriptGroup
		{
			get
			{
				return GetScriptGroup(defaultGroup);
			}
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="groupName"></param>
		/// <returns></returns>
		public SharedScriptGroup GetScriptGroup(string groupName)
		{
			return scriptGroups[groupName];
		}
	}
}